package com.tinama.jedis01.demo;

import java.lang.reflect.Array;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author lgc
 * @createDate 2020/10/29 - 15:24
 */
public class ArrayDemo {
    public static void main(String[] args) throws ParseException {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat();
        simpleDateFormat.parse("");
        ArrayList<Object> list = new ArrayList<>(Arrays.asList(1,2,3,4,5,6,7,8,9));
//        int size = list.size();
        for (int i = 0; i < list.size(); ++i) {
            if ((int)list.get(i)%2==0){
                list.remove(i);
                System.out.println(i);
                i--;
            }
        }
//        System.out.println(list);
//        list.removeIf(l->(int)l%2==0);


        System.out.println(list);

    }
}
